import request from '@/utils/request'

const api_name = '/admin/system/sysDept'

export default {

    findNodes() {
        return request({
          url: `${api_name}/findNodes`,
          method: 'get'
        })
      },

  getById(id) {
    return request({
      url: `${api_name}/get/${id}`,
      method: 'get'
    })
  },

  removeById(id) {
    return request({
      url: `${api_name}/remove/${id}`,
      method: 'delete'
    })
  },

  save(sysDept) {
    return request({
      url: `${api_name}/save`,
      method: 'post',
      data: sysDept
    })
  },

  updateById(sysDept) {
    return request({
      url: `${api_name}/update`,
      method: 'put',
      data: sysDept
    })
  },

  updateStatus(id, status) {
    return request({
      url: `${api_name}/updateStatus/${id}/${status}`,
      method: 'get'
    })
  },

  getDepts(adminId){
    return request({
      url: `${api_name}/toAssign/${adminId}`,
      method: 'get'
    })
  }
}